<%@ Page Title="Pay_PPayResults Item" Language="C#" AutoEventWireup="true" CodeBehind="Pay_PPayResultsItem.aspx.cs" Inherits="Youz.CreditRepay.Manage.Pay_PPayResultsItem" %>
<script>
    //loadCSS("UIResources/Scripts/jquery.validate/valid.css");

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script><div class="row"><div class="col-lg-12"><div class="panel panel-default"><div class="panel-heading"><h2><i class="fa fa-edit"></i><%: R(LanguageModule.Pay_PPayResults, "Pay_PPayResults", "Pay_PPayResults") %></h2></div><div class="panel-body"><form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/Pay_PPayResultsHandler.ashx?type=save"><input id="MerchOrderId" name="MerchOrderId" type="hidden" />
<div class="form-group">
<label class="control-label" for="ID"><%: R(LanguageModule.Pay_PPayResults, "ID", "ID") %></label>
<div class="controls"><input type="text" id="ID" name="ID" maxlength="4" class="form-control required" /></div>
</div>
<div class="form-group">
<label class="control-label" for="TradeCode"><%: R(LanguageModule.Pay_PPayResults, "TradeCode", "TradeCode") %></label>
<div class="controls"><input type="text" id="TradeCode" name="TradeCode" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Version"><%: R(LanguageModule.Pay_PPayResults, "Version", "Version") %></label>
<div class="controls"><input type="text" id="Version" name="Version" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="MerchantId"><%: R(LanguageModule.Pay_PPayResults, "MerchantId", "MerchantId") %></label>
<div class="controls"><input type="text" id="MerchantId" name="MerchantId" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="OrderId"><%: R(LanguageModule.Pay_PPayResults, "OrderId", "OrderId") %></label>
<div class="controls"><input type="text" id="OrderId" name="OrderId" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RetCode"><%: R(LanguageModule.Pay_PPayResults, "RetCode", "RetCode") %></label>
<div class="controls"><input type="text" id="RetCode" name="RetCode" maxlength="50" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="RetMsg"><%: R(LanguageModule.Pay_PPayResults, "RetMsg", "RetMsg") %></label>
<div class="controls"><textarea id="RetMsg" name="RetMsg" rows="3" maxlength="1000" class="form-control"></textarea></div>
</div>
<div class="form-group">
<label class="control-label" for="Status"><%: R(LanguageModule.Pay_PPayResults, "Status", "Status") %></label>
<div class="controls"><input type="text" id="Status" name="Status" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Message"><%: R(LanguageModule.Pay_PPayResults, "Message", "Message") %></label>
<div class="controls"><input type="text" id="Message" name="Message" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="PayTime"><%: R(LanguageModule.Pay_PPayResults, "PayTime", "PayTime") %></label>
<div class="controls"><input type="text" id="PayTime" name="PayTime" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="SettleDate"><%: R(LanguageModule.Pay_PPayResults, "SettleDate", "SettleDate") %></label>
<div class="controls"><input type="text" id="SettleDate" name="SettleDate" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CreatedOn"><%: R(LanguageModule.Pay_PPayResults, "CreatedOn", "CreatedOn") %></label>
<div class="controls"><input type="text" id="CreatedOn" name="CreatedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ModifiedOn"><%: R(LanguageModule.Pay_PPayResults, "ModifiedOn", "ModifiedOn") %></label>
<div class="controls"><input type="text" id="ModifiedOn" name="ModifiedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="alert alert-danger" style="display: none;"><button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div><div class="form-actions"><button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
						<button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button></div></form></div></div></div></div><script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("Pay/Handlers/Pay_PPayResultsHandler.ashx?type=get", { MerchOrderId: "<%= WebHelper.Get("MerchOrderId") %>" }, function (data) {
                $('#frm').fill(data);
            }, 'json');
        }

        $(function () {
            $("#frm").validate({
                errorElement: "span"
            });

            get();

            $("#frm").ajaxForm({
                dataType: 'json',
                beforeSubmit: function (arr, $form, options) {
                    if (flag) {
                        return false;
                    }
                    else {
                        flag = true;
                        return true;
                    }
                },
                success: function (data) {
                    if (data.isSuccess) {
                        loadPage("Pay/Pay_PPayResultsList.aspx");
                    }
                    else {
                        $(".alert > .content").html(data.message);
                        $(".alert").show();
                    }
                    flag = false;
                }
            });

            $("#btnCancel").click(function () {
                loadPage("Pay/Pay_PPayResultsList.aspx");				
            });
        });

</script>